@cd /d %~dp0
@echo off
color 8f
echo.
echo Title: Git Instruction Set
echo .
echo Author: Tejin-Ning
echo.
echo File coding: ANSI (Transcoding can be messy)
echo.
echo Instructions: 
echo 	Put the script in the Git repository,
echo 	double-click to run it, and follow the prompts.
echo.
echo Current file path: 
echo 	%~dp0
echo.
echo Warning: Make sure this is the correct storage path, 
echo		 otherwise change the instruction set to run on the correct path. 
echo.
echo.
echo ############### Git Instruction List #################  
echo ------------ Input number 0: git clone --------------- 
echo ------------ Input number 1: git fetch --------------- 
echo ------------ Input number 2: git pull  --------------- 
echo ------------ Input number 3: git add . --------------- 
echo ------------ Input number 4: git commit -m "message" - 
echo ------------ Input number 5: git push origin master -- 
echo ------------ More to come... -------------------------
echo ------------ Other instructions end the task. --------
echo ------------------------------------------------------ 
echo.
:again
echo Select the Instruction to execute:
set /p num=

setlocal EnableDelayedExpansion
if "%num%"=="0" (
	set /p href=Input submission href:  
	git clone "!href!"
	echo.
	echo. --- Instruction "%num%" is done.
	echo.
	echo.
	goto again
)


if "%num%"=="1" (
	git fetch
	echo.
	echo. --- Instruction "%num%" is done.
	echo.
	echo.
	goto again
)

if "%num%"=="2" (
	git pull
	echo.
	echo. --- Instruction "%num%" is done.
	echo.
	echo.
	goto again
)

if "%num%"=="3" (
	git add .
	echo.
	echo. --- Instruction "%num%" is done.
	echo.
	echo.
	goto again
)

setlocal EnableDelayedExpansion
if "%num%"=="4" (
	set /p message=Input submission remarks:  
	git commit -m "!message!"
	echo.
	echo. --- Instruction "%num%" is done.
	echo.
	echo.
	goto again
)

if "%num%"=="5" (
	git push origin master
	echo.
	echo. --- Instruction "%num%" is done.
	echo.
	echo.
	goto again
)

echo.
echo When the "%num%" instruction is entered, 
echo 	the batch rolls out automatically.
echo.
echo Any key, close instruction set.
echo.
pause
